<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的考卷</title>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="js/jquery-easyui-1.5.4.2/locale/easyui-lang-zh_CN.js"/>"></script>
<link id="theme" rel="stylesheet" type="text/css"  href="<c:url value="js/jquery-easyui-1.5.4.2/themes/ui-cupertino/easyui.css"/>"/>
<link  rel="stylesheet" type="text/css" href="<c:url value="js/jquery-easyui-1.5.4.2/themes/icon.css"/>"/>
<body>
<script>
        function onSelect(d) {
        var issd = this.id == 'wdkj_sd', sd = issd ? d : new Date($('#wdkj_sd').datebox('getValue')), ed = issd ? new Date($('#wdkj_ed').datebox('getValue')) : d;
            if (ed < sd) {
                alert('结束日期小于开始日期');
                //只要选择了日期，不管是开始或者结束都对比一下，如果结束小于开始，则清空结束日期的值并弹出日历选择框
                $('#wdkj_ed').datebox('setValue', '').datebox('open');
            }
        }
 </script>

	<table id="sousuo" class="easyui-datagrid" style="text-align:center;width:100%" data-options="
		pagination:true,
		pageSize:1,
		pageList:[1,2,3,4,5],
		url:'to_kssj_findAll',
		method:'post',
		fitColumns:true,
		fit:true,
		nowrap:false,
		autoRowHeight:true,
		rownumbers:true,
		singleSelect:true,
		striped:true,
		toolbar:'#seach'
	">
		<thead>
			<tr>
				<th data-options="field:'epId',align:'center',width:'30'">编号</th>
				<th data-options="field:'arrangeName',align:'center',width:'50'">考试安排</th>
				<th data-options="field:'quName',align:'center',width:'30'">题库</th>
				<th data-options="field:'classSjName',align:'center',width:'50'">试卷名称</th>
				<th data-options="field:'epStarttime',align:'center',width:'80',
				formatter:function(value,row,index){
					var date= new Date(value);
					return date.toLocaleString();
				}">开始日期</th>
				<th data-options="field:'epEndtime',align:'center',width:'80',
				formatter:function(value,row,index){
					var date= new Date(value);
					return date.toLocaleString();
				}">结束时间</th>
				<th data-options="field:'epShichang',align:'center',width:'30'">时长</th>
				<th data-options="field:'epDefen',align:'center',width:'30'">得分</th> 
				<th data-options="field:'epState',align:'center',width:'30'">考卷状态</th>
			</tr>
		</thead>
		<tbody>
		</tbody>
	</table>
	<div id="seach">
		考卷状态 <select class="easyui-combobox" data-options="width:100,height:25,panelHeight:'auto'">
				<option>未开考</option>
				<option>考试中</option>
				<option>已交卷</option>
				<option>已评分</option>
				<option>考试作废</option>
			</select>
		开始日期：<input class="easyui-datebox" id="wdkj_sd" data-options="onSelect:onSelect,editable:false,width:100" />
		结束日期：<input class="easyui-datebox" id="wdkj_ed" data-options="onSelect:onSelect,editable:false,width:100" />
		搜索文本  <input id="bir" class="easyui-searchbox" data-options="width:100,
		searcher:function(value,name){
				$('#sousuo').datagrid('load','wdkj_query?classSjName='+value);
			}">
		<a id="btn" class="easyui-linkbutton" data-options="width:60,plain:false,text:'搜索'"></a> 
	</div>
</body>
</html>